#include "pch.h"
#include "CCircle.h"

CCircle::CCircle()
{
}

CCircle::~CCircle()
{
}

void CCircle::SetPoints(CPoint2D* p)
{
	for (int i = 0; i < 12; ++i)
	{
		points[i] = p[i];
	}

	SetCurve();
}

void CCircle::SetCurve()
{
	curves[0].SetPoints(points[0], points[1], points[2], points[3]);
	curves[1].SetPoints(points[3], points[4], points[5], points[6]);
	curves[2].SetPoints(points[6], points[7], points[8], points[9]);
	curves[3].SetPoints(points[9], points[10], points[11], points[0]);
}

void CCircle::SetStep(int s)
{
	for (int i = 0; i < 4; ++i)
		curves[i].SetStep(s);
}

void CCircle::DrawCircle(CDC* pDC)
{
	for (int i = 0; i < 4; ++i)
	{
		curves[i].CalCulateCurve();
		curves[i].DrawPolyon(pDC);
		curves[i].DrawCurve(pDC);
	}


}
